Produced by Araxis Merge on 2023-03-13 03:00:45 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.4/Porto Theme/app/code/Smartwave/Megamenu/view/frontend/templates/onepagecategory | onepagecategory.phtml | 2019-09-10 14:36:04 +0000 |
| 2 | Porto v4.0.5/Porto Theme/app/code/Smartwave/Megamenu/view/frontend/templates/onepagecategory | onepagecategory.phtml | 2019-09-10 14:36:04 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 374 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | /** | 2 | /** | |||
| 3 | * Copyright © 2018 Porto. All rights reserved. | 3 | * Copyright © 2018 Porto. All rights reserved. | |||
| 4 | */ | 4 | */ | |||
| 5 | 5 | |||||
| 6 | ?> | 6 | ?> | |||
| 7 | <?php | 7 | <?php | |||
| 8 | /** | 8 | /** | |||
| 9 | * Top menu for store | 9 | * Top menu for store | |||
| 10 | * | 10 | * | |||
| 11 | * @see \Smartwave\Megamenu\Block\Topmenu | 11 | * @see \Smartwave\Megamenu\Block\Topmenu | |||
| 12 | */ | 12 | */ | |||
| 13 | ?> | 13 | ?> | |||
| 14 | <?php | 14 | <?php | |||
| 15 | $_helper = $this->helper('Smartwave\Megamenu\Helper\Data'); | 15 | $_helper = $this->helper('Smartwave\Megamenu\Helper\Data'); | |||
| 16 | $_portohelper = $this->helper('Smartwave\Porto\Helper\Data'); | 16 | $_portohelper = $this->helper('Smartwave\Porto\Helper\Data'); | |||
| 17 | 17 | |||||
| 18 | $categories = $_helper->getFirstLevelCategories(); | 18 | $categories = $_helper->getFirstLevelCategories(); | |||
| 19 | $_category_config = $_portohelper->getConfig('porto_settings/category'); | 19 | $_category_config = $_portohelper->getConfig('porto_settings/category'); | |||
| 20 | $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid'); | 20 | $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid'); | |||
| 21 | 21 | |||||
| 22 | $aspect_ratio = $this->getData("aspect_ratio"); | 22 | $aspect_ratio = $this->getData("aspect_ratio"); | |||
| 23 | if($aspect_ratio == null) { | 23 | if($aspect_ratio == null) { | |||
| 24 | $aspect_ratio = $_category_config['aspect_ratio']; | 24 | $aspect_ratio = $_category_config['aspect_ratio']; | |||
| 25 | } | 25 | } | |||
| 26 | $ratio_width = $this->getData("image_width"); | 26 | $ratio_width = $this->getData("image_width"); | |||
| 27 | if(!$ratio_width) { | 27 | if(!$ratio_width) { | |||
| 28 | $ratio_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300; | 28 | $ratio_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300; | |||
| 29 | } | 29 | } | |||
| 30 | $ratio_height = $this->getData("image_height"); | 30 | $ratio_height = $this->getData("image_height"); | |||
| 31 | if(!$ratio_height) { | 31 | if(!$ratio_height) { | |||
| 32 | $ratio_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300; | 32 | $ratio_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300; | |||
| 33 | } | 33 | } | |||
| 34 | 34 | |||||
| 35 | $move_actions= $this->getData("move_actions"); | 35 | $move_actions= $this->getData("move_actions"); | |||
| 36 | if(!$move_actions) | 36 | if(!$move_actions) | |||
| 37 | $move_actions = 0; | 37 | $move_actions = 0; | |||
| 38 | $lazy_owl = $this->getData("lazy_owl"); | 38 | $lazy_owl = $this->getData("lazy_owl"); | |||
| 39 | if(!$lazy_owl) | 39 | if(!$lazy_owl) | |||
| 40 | $lazy_owl = 0; | 40 | $lazy_owl = 0; | |||
| 41 | $product_count = $this->getData("product_count"); | 41 | $product_count = $this->getData("product_count"); | |||
| 42 | if(!$product_count) | 42 | if(!$product_count) | |||
| 43 | $product_count = 12; | 43 | $product_count = 12; | |||
| 44 | $columns = $this->getData("columns"); | 44 | $columns = $this->getData("columns"); | |||
| 45 | if(!$columns) | 45 | if(!$columns) | |||
| 46 | $columns = "{0:{items:2},768:{items:3},992:{items:4},1200:{items:5}}"; | 46 | $columns = "{0:{items:2},768:{items:3},992:{items:4},1200:{items:5}}"; | |||
| 47 | 47 | |||||
| 48 | $product_type = $this->getData("product_type"); | 48 | $product_type = $this->getData("product_type"); | |||
| 49 | if($product_type == null) { | 49 | if($product_type == null) { | |||
| 50 | $product_type = $_category_grid_config['product_type']; | 50 | $product_type = $_category_grid_config['product_type']; | |||
| 51 | } | 51 | } | |||
| 52 | if($product_type == null) { | 52 | if($product_type == null) { | |||
| 53 | $product_type = 1; | 53 | $product_type = 1; | |||
| 54 | } | 54 | } | |||
| 55 | 55 | |||||
| 56 | $custom_styles='<style type="text/css">'; | 56 | $custom_styles='<style type="text/css">'; | |||
| 57 | ?> | 57 | ?> | |||
| 58 | <div class="onepage-category"> | 58 | <div class="onepage-category"> | |||
| 59 | <div class="category-list"> | 59 | <div class="category-list"> | |||
| 60 | <ul> | 60 | <ul> | |||
| 61 | <?php | 61 | <?php | |||
| 62 | $i = 0; | 62 | $i = 0; | |||
| 63 | foreach($categories as $category) { | 63 | foreach($categories as $category) { | |||
| 64 | $cat_id = $category->getId(); | 64 | $cat_id = $category->getId(); | |||
| 65 | $cat_model = $_helper->getCategoryModel($cat_id); | 65 | $cat_model = $_helper->getCategoryModel($cat_id); | |||
| 66 | if($category->getIsActive() && !$cat_model->getData("sw_ocat_hide_this_item")) { | 66 | if($category->getIsActive() && !$cat_model->getData("sw_ocat_hide_this_item")) { | |||
| 67 | $icon = '<em class="porto-icon-circle-empty"></em>'; | 67 | $icon = '<em class="porto-icon-circle-empty"></em>'; | |||
| 68 | if($cat_icon_img=$cat_model->getData("sw_ocat_category_icon_image")) { | 68 | if($cat_icon_img=$cat_model->getData("sw_ocat_category_icon_image")) { | |||
| 69 | $icon = '<img src="'.'catalog/category/'.$cat_icon_img.'" alt=""/>'; | 69 | $icon = '<img src="'.'catalog/category/'.$cat_icon_img.'" alt=""/>'; | |||
| 70 | } else if($cat_font_icon=$cat_model->getData("sw_ocat_category_font_icon")){ | 70 | } else if($cat_font_icon=$cat_model->getData("sw_ocat_category_font_icon")){ | |||
| 71 | $icon = '<em class="'.$cat_font_icon.'"></em>'; | 71 | $icon = '<em class="'.$cat_font_icon.'"></em>'; | |||
| 72 | } | 72 | } | |||
| 73 | if($hover_bg_color = $cat_model->getData("sw_ocat_category_hoverbgcolor")) | 73 | if($hover_bg_color = $cat_model->getData("sw_ocat_category_hoverbgcolor")) | |||
| 74 | $custom_styles .= '.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"]:hover,.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"].active{background-color:'.$hover_bg_color.';}.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"]:hover:after,.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"].active:after{border-left-color:'.$hover_bg_color.';}'; | 74 | $custom_styles .= '.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"]:hover,.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"].active{background-color:'.$hover_bg_color.';}.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"]:hover:after,.onepage-category .category-list > ul > li > a[data-cat="'.$cat_id.'"].active:after{border-left-color:'.$hover_bg_color.';}'; | |||
| 75 | echo '<li data-index="'.$i.'"><a href="javascript:void(0)" data-cat="'.$cat_id.'">'.$icon.'<span>'.$category->getName().'</span></a></li>'; | 75 | echo '<li data-index="'.$i.'"><a href="javascript:void(0)" data-cat="'.$cat_id.'">'.$icon.'<span>'.$category->getName().'</span></a></li>'; | |||
| 76 | $i++; | 76 | $i++; | |||
| 77 | } | 77 | } | |||
| 78 | } | 78 | } | |||
| 79 | ?> | 79 | ?> | |||
| 80 | </ul> | 80 | </ul> | |||
| 81 | <?php | 81 | <?php | |||
| 82 | $custom_styles .= '</style>'; | 82 | $custom_styles .= '</style>'; | |||
| 83 | echo $custom_styles; | 83 | echo $custom_styles; | |||
| 84 | ?> | 84 | ?> | |||
| 85 | </div> | 85 | </div> | |||
| 86 | <div class="category-details"> | 86 | <div class="category-details"> | |||
| 87 | <?php | 87 | <?php | |||
| 88 | foreach($categories as $category) { | 88 | foreach($categories as $category) { | |||
| 89 | $cat_id = $category->getId(); | 89 | $cat_id = $category->getId(); | |||
| 90 | $cat_model = $_helper->getCategoryModel($cat_id); | 90 | $cat_model = $_helper->getCategoryModel($cat_id); | |||
| 91 | if($category->getIsActive() && !$cat_model->getData("sw_ocat_hide_this_item")) { | 91 | if($category->getIsActive() && !$cat_model->getData("sw_ocat_hide_this_item")) { | |||
| 92 | $activeChildren = $_helper->getActiveChildCategories($cat_model); | 92 | $activeChildren = $_helper->getActiveChildCategories($cat_model); | |||
| 93 | $a_class = ''; | 93 | $a_class = ''; | |||
| 94 | $popup = ''; | 94 | $popup = ''; | |||
| 95 | if (count($activeChildren)) { | 95 | if (count($activeChildren)) { | |||
| 96 | $a_class = ' class="parent"'; | 96 | $a_class = ' class="parent"'; | |||
| 97 | $popup = '<div class="menu-popup">'.$_helper->getSubmenuItemsHtml($activeChildren, 0, 2).'</div>'; | 97 | $popup = '<div class="menu-popup">'.$_helper->getSubmenuItemsHtml($activeChildren, 0, 2).'</div>'; | |||
| 98 | } | 98 | } | |||
| 99 | 99 | |||||
| 100 | $title_menu = '<a href="javascript:void(0)" data-id="'.$cat_id.'"'.$a_class.'><span>'.$cat_model->getName().'</span></a>'.$popup; | 100 | $title_menu = '<a href="javascript:void(0)" data-id="'.$cat_id.'"'.$a_class.'><span>'.$cat_model->getName().'</span></a>'.$popup; | |||
| 101 | 101 | |||||
| 102 | $resultPage = $_helper->getResultPageFactory()->create(); | 102 | $resultPage = $_helper->getResultPageFactory()->create(); | |||
| 103 | $products = $resultPage->getLayout()->createBlock('Smartwave\Filterproducts\Block\Home\LatestList') | 103 | $products = $resultPage->getLayout()->createBlock('Smartwave\Filterproducts\Block\Home\LatestList') | |||
| 104 | ->setTemplate('Smartwave_Megamenu::onepagecategory/products_area.phtml') | 104 | ->setTemplate('Smartwave_Megamenu::onepagecategory/products_area.phtml') | |||
| 105 | ->setData('category_id',$cat_id) | 105 | ->setData('category_id',$cat_id) | |||
| 106 | ->setData('aspect_ratio',$aspect_ratio) | 106 | ->setData('aspect_ratio',$aspect_ratio) | |||
| 107 | ->setData('image_width',$ratio_width) | 107 | ->setData('image_width',$ratio_width) | |||
| 108 | ->setData('image_height',$ratio_height) | 108 | ->setData('image_height',$ratio_height) | |||
| 109 | ->setData('lazy_owl',$lazy_owl) | 109 | ->setData('lazy_owl',$lazy_owl) | |||
| 110 | ->setData('product_count',$product_count) | 110 | ->setData('product_count',$product_count) | |||
| 111 | ->setData('columns',$columns) | 111 | ->setData('columns',$columns) | |||
| 112 | ->setData('product_type',$product_type) | 112 | ->setData('product_type',$product_type) | |||
| 113 | ->toHtml(); | 113 | ->toHtml(); | |||
| 114 | 114 | |||||
| 115 | $additional_content = $_helper->getBlockContent($cat_model->getData("sw_ocat_additional_content")); | 115 | $additional_content = $_helper->getBlockContent($cat_model->getData("sw_ocat_additional_content")); | |||
| 116 | ?> | 116 | ?> | |||
| 117 | <div id="category_<?php echo $cat_id; ?>" class="category-detail"> | 117 | <div id="category_<?php echo $cat_id; ?>" class="category-detail"> | |||
| 118 | <div class="title-menu"><?php echo $title_menu; ?></div> | 118 | <div class="title-menu"><?php echo $title_menu; ?></div> | |||
| 119 | <div class="products-area"><?php echo $products; ?></div> | 119 | <div class="products-area"><?php echo $products; ?></div> | |||
| 120 | <div class="additional-content"><?php echo $additional_content; ?></div> | 120 | <div class="additional-content"><?php echo $additional_content; ?></div> | |||
| 121 | </div> | 121 | </div> | |||
| 122 | <?php | 122 | <?php | |||
| 123 | } | 123 | } | |||
| 124 | } | 124 | } | |||
| 125 | ?> | 125 | ?> | |||
| 126 | </div> | 126 | </div> | |||
| 127 | <script type="text/javascript"> | 127 | <script type="text/javascript"> | |||
| 128 | require([ | 128 | require([ | |||
| 129 | 'jquery' | 129 | 'jquery' | |||
| 130 | ], function ($) { | 130 | ], function ($) { | |||
| 131 | $(".category-detail > .title-menu > a.parent").off("click").on("click", function(e){ | 131 | $(".category-detail > .title-menu > a.parent").off("click").on("click", function(e){ | |||
| 132 | if($(this).hasClass("opened")) { | 132 | if($(this).hasClass("opened")) { | |||
| 133 | $(this).parent().children(".menu-popup").fadeOut(200); | 133 | $(this).parent().children(".menu-popup").fadeOut(200); | |||
| 134 | $(this).removeClass("opened"); | 134 | $(this).removeClass("opened"); | |||
| 135 | } else { | 135 | } else { | |||
| 136 | $(this).addClass("opened"); | 136 | $(this).addClass("opened"); | |||
| 137 | $(this).parent().children(".menu-popup").fadeIn(200); | 137 | $(this).parent().children(".menu-popup").fadeIn(200); | |||
| 138 | } | 138 | } | |||
| 139 | e.stopPropagation(); | 139 | e.stopPropagation(); | |||
| 140 | }); | 140 | }); | |||
| 141 | $(".category-detail > .title-menu > a.parent").parent().click(function(e){ | 141 | $(".category-detail > .title-menu > a.parent").parent().click(function(e){ | |||
| 142 | e.stopPropagation(); | 142 | e.stopPropagation(); | |||
| 143 | }); | 143 | }); | |||
| 144 | $("html,body").click(function(){ | 144 | $("html,body").click(function(){ | |||
| 145 | $(".category-detail > .title-menu > a.parent").parent().children(".menu-popup").fadeOut(200); | 145 | $(".category-detail > .title-menu > a.parent").parent().children(".menu-popup").fadeOut(200); | |||
| 146 | $(".category-detail > .title-menu > a.parent").removeClass("opened"); | 146 | $(".category-detail > .title-menu > a.parent").removeClass("opened"); | |||
| 147 | }); | 147 | }); | |||
| 148 | $(".onepage-category .category-list > ul > li > a").off("click").on("click", function(){ | 148 | $(".onepage-category .category-list > ul > li > a").off("click").on("click", function(){ | |||
| 149 | cat_id = $(this).attr("data-cat"); | 149 | cat_id = $(this).attr("data-cat"); | |||
| 150 | $("#category_"+cat_id).scrollToMe(); | 150 | $("#category_"+cat_id).scrollToMe(); | |||
| 151 | var cur_item = $(this); | 151 | var cur_item = $(this); | |||
| 152 | setTimeout(function(){ | 152 | setTimeout(function(){ | |||
| 153 | $(".onepage-category .category-list > ul > li > a").removeClass("active"); | 153 | $(".onepage-category .category-list > ul > li > a").removeClass("active"); | |||
| 154 | $(cur_item).addClass("active"); | 154 | $(cur_item).addClass("active"); | |||
| 155 | },500); | 155 | },500); | |||
| 156 | }); | 156 | }); | |||
| 157 | $(window).scroll(function(){ | 157 | $(window).scroll(function(){ | |||
| 158 | $(".onepage-category .category-list > ul > li > a").each(function(){ | 158 | $(".onepage-category .category-list > ul > li > a").each(function(){ | |||
| 159 | if($("#category_"+$(this).attr("data-cat")).offset() && ($(window).scrollTop() >= $("#category_"+$(this).attr("data-cat")).offset().top - $(window).innerHeight() / 2) && ($(window).scrollTop() <= $("#category_"+$(this).attr("data-cat")).offset().top + $("#category_"+$(this).attr("data-cat")).height() - $(window).innerHeight() / 2)) { | 159 | if($("#category_"+$(this).attr("data-cat")).offset() && ($(window).scrollTop() >= $("#category_"+$(this).attr("data-cat")).offset().top - $(window).innerHeight() / 2) && ($(window).scrollTop() <= $("#category_"+$(this).attr("data-cat")).offset().top + $("#category_"+$(this).attr("data-cat")).height() - $(window).innerHeight() / 2)) { | |||
| 160 | $(this).addClass("active"); | 160 | $(this).addClass("active"); | |||
| 161 | $(".onepage-category .category-list > ul > li > a:not([data-cat='"+$(this).attr("data-cat")+"'])").removeClass("active"); | 161 | $(".onepage-category .category-list > ul > li > a:not([data-cat='"+$(this).attr("data-cat")+"'])").removeClass("active"); | |||
| 162 | } | 162 | } | |||
| 163 | }); | 163 | }); | |||
| 164 | if($(".onepage-category .category-list > ul").outerHeight() < $(this).innerHeight()) { | 164 | if($(".onepage-category .category-list > ul").outerHeight() < $(this).innerHeight()) { | |||
| 165 | $(".onepage-category .category-list > ul").removeClass("fixed-bottom"); | 165 | $(".onepage-category .category-list > ul").removeClass("fixed-bottom"); | |||
| 166 | if($(this).scrollTop() >= $(".onepage-category .category-list").offset().top - 24) { | 166 | if($(this).scrollTop() >= $(".onepage-category .category-list").offset().top - 24) { | |||
| 167 | $(".onepage-category .category-list > ul").addClass("fixed-top"); | 167 | $(".onepage-category .category-list > ul").addClass("fixed-top"); | |||
| 168 | } else { | 168 | } else { | |||
| 169 | $(".onepage-category .category-list > ul").removeClass("fixed-top"); | 169 | $(".onepage-category .category-list > ul").removeClass("fixed-top"); | |||
| 170 | } | 170 | } | |||
| 171 | } else { | 171 | } else { | |||
| 172 | $(".onepage-category .category-list > ul").removeClass("fixed-top"); | 172 | $(".onepage-category .category-list > ul").removeClass("fixed-top"); | |||
| 173 | if($(this).scrollTop() >= $(".onepage-category .category-list").offset().top + $(".onepage-category .category-list > ul").outerHeight() + 46 - $(this).innerHeight()) { | 173 | if($(this).scrollTop() >= $(".onepage-category .category-list").offset().top + $(".onepage-category .category-list > ul").outerHeight() + 46 - $(this).innerHeight()) { | |||
| 174 | $(".onepage-category .category-list > ul").addClass("fixed-bottom"); | 174 | $(".onepage-category .category-list > ul").addClass("fixed-bottom"); | |||
| 175 | } else { | 175 | } else { | |||
| 176 | $(".onepage-category .category-list > ul").removeClass("fixed-bottom"); | 176 | $(".onepage-category .category-list > ul").removeClass("fixed-bottom"); | |||
| 177 | } | 177 | } | |||
| 178 | } | 178 | } | |||
| 179 | if(($(".onepage-category .category-list > ul").hasClass("fixed-bottom") && ($(this).scrollTop() + $(window).innerHeight() >= $(".page-footer").offset().top)) || ($(".onepage-category .category-list > ul").hasClass("fixed-top") && ($(this).scrollTop() + $(window).innerHeight() >= $(".page-footer").offset().top) && ($(".onepage-category .category-list > ul").offset().top + $(".onepage-category .category-list > ul").outerHeight() >= $(".page-footer").offset().top) && ($(this).scrollTop() + $(".onepage-category .category-list > ul").outerHeight() + 70 >= $(".page-footer").offset().top))) { | 179 | if(($(".onepage-category .category-list > ul").hasClass("fixed-bottom") && ($(this).scrollTop() + $(window).innerHeight() >= $(".page-footer").offset().top)) || ($(".onepage-category .category-list > ul").hasClass("fixed-top") && ($(this).scrollTop() + $(window).innerHeight() >= $(".page-footer").offset().top) && ($(".onepage-category .category-list > ul").offset().top + $(".onepage-category .category-list > ul").outerHeight() >= $(".page-footer").offset().top) && ($(this).scrollTop() + $(".onepage-category .category-list > ul").outerHeight() + 70 >= $(".page-footer").offset().top))) { | |||
| 180 | $(".onepage-category .category-list > ul").addClass("absolute-bottom"); | 180 | $(".onepage-category .category-list > ul").addClass("absolute-bottom"); | |||
| 181 | } else { | 181 | } else { | |||
| 182 | $(".onepage-category .category-list > ul").removeClass("absolute-bottom"); | 182 | $(".onepage-category .category-list > ul").removeClass("absolute-bottom"); | |||
| 183 | } | 183 | } | |||
| 184 | }); | 184 | }); | |||
| 185 | }); | 185 | }); | |||
| 186 | </script> | 186 | </script> | |||
| 187 | </div> | 187 | </div> |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.